<?php
/**
 * @var $this Pinenut\Action
 * @var $messages Messenger\Messages[]
 * @var $myProfileId string
 * @var $showPaginationButton bool
 * @var $groupId string
 * @var $companionProfileId string
 * @var $beforeTimestamp string
 */
?>
<?php if ($showPaginationButton) : ?>
    <div id="messenger-messages-pagination-button" style="text-align: center">
        <a href="#" gid="<?php echo $groupId; ?>" cid="<?php echo $companionProfileId; ?>" beforeTimestamp="<?php echo $beforeTimestamp; ?>">previous messages...</a>
    </div>
<?php endif; ?>
<?php foreach ($messages as $message) : ?>
    <?php echo $this->action(
        '.item',
        [
            'messageId' => (string) $message,
            'messageIsMine' => $message->belongsToProfile($myProfileId),
        ]
    ) ?>
<?php endforeach; ?>
